package week1;
import java.util.Scanner;
public class Timu3 {

	public static void main(String[] args) {
		Scanner a=new Scanner(System.in);
		while(a.hasNext())
		{
			double num=a.nextDouble();
			num=Math.abs(num);
			String st=String.valueOf(num);
			int i=0;
			int sum=0;
			char []b=st.toCharArray();
			for(i=0;i<st.length();i++)
			{
				sum+=b[i];
			}
			System.out.println(sum);
			StringBuilder
		}
        
	}

}
